<template>
	<view class="container">
		<uni-nav-bar leftIcon="back" @clickLeft="goBack" statusBar="true" custom="true" fixed="true" :color="navColor"
		 :background="navBg" title="产品详情">

		</uni-nav-bar>
		<!-- #ifdef MP-WEIXIN -->
		<view class="goBack" v-show="backIconShow" :style="{top: fixedTop + 'px'}" @tap="goBack">
			<text class="yticon icon-zuo"></text>
		</view>
		<!-- #endif -->
		<!-- #ifdef APP-PLUS -->
		<view class="navigation" v-show="backIconShow">
			<view class="back" @tap="goBack">
				<text class="yticon icon-zuo"></text>
			</view>
			<view class="right">
				<view class="a" @tap="share">
					<image src="../../../mall/static/images/acd321.png" mode="widthFix"></image>
				</view>
				<view class="a b" @tap="navTo('/pages/index/index')">
					<image src="../../../mall/static/images/acd123.png" mode="widthFix"></image>
				</view>
			</view>
		</view>
		<!-- #endif -->
		<view class="carousel">
			<swiper circular=true duration="400" autoplay>
				<block v-for="(item,index) in storeInfo.slider_image" :key="index">
					<swiper-item class="swiper-item">
						<view class="image-wrapper">
							<easy-loadimage mode="widthFix" :scroll-top="scrollTop" :image-src="item"></easy-loadimage>
						</view>
					</swiper-item>
				</block>
			</swiper>
		</view>

		<view class="introduce-section">
			<view class="pd-30">
				<view class="price-box">
					<text class="disc">套餐价：</text>
					￥
					<text class="price">{{selectDisObj.price}}</text>
				</view>
				<view class="title">
					{{storeInfo.store_name}}
				</view>
				<view class="tags">
					<text v-if="storeInfo.send_k1vip">赠送k1会员</text>
					<text v-if="storeInfo.send_travel_card">赠送旅游卡</text>
					<text v-if="storeInfo.send_gift_bag">赠送礼包</text>
				</view>

				<view class="bot-row">
					<text>销量: {{storeInfo.ficti + storeInfo.sales}}</text>
					<text>库存: {{storeInfo.stock}}</text>
					<text>运费: 免运费</text>
					<text>浏览量: {{storeInfo.browse}}</text>
				</view>
			</view>
		</view>
		<view class="cut" v-if="data.productAttr.length"></view>
		<!-- v-if="data.productAttr.length" -->
		<view class="c-list">
			<view class="c-row" @click="toggleSpec(3)">
				<text class="tit">规格</text>
				<view class="con">
					<text class="selected-text">{{selectDisObj.suk}}</text>
				</view>
				<text class="yticon icon-you"></text>
			</view>
		</view>
		<view class="cut"></view>
		<!-- 评价 -->
		<view class="eva-section">

			<view class="e-header" @tap="navTo('/mall/product/comments?goodsId='+data.storeInfo.id)">
				<text class="tit">评价</text>
				<text class="descc">({{data.replyCount}})</text>
				<text class="desc tip">查看全部评论</text>
				<text class="yticon icon-you"></text>
			</view>
			<view class="eva-box" v-if="data.replyCount > 0">
				<image lazy-load class="portrait" :src="reply.avatar"></image>
				<view class="right">
					<text class="name">{{reply.nickname}}</text>
					<text class="con">{{reply.comment}}</text>
					<view class="comment-pics">
						<image @tap.stop="previewPic(reply.pics,index)" v-for="(item,index) in reply.pics" :key="index" :src="item" mode="aspectFill"></image>
					</view>
					<view class="bot">
						<text class="attr">购买类型：{{reply.suk || ''}}</text>
						<text class="time">{{reply.add_time}}</text>
					</view>
				</view>
			</view>
			<view class="more-comm" @tap="navTo('/mall/product/comments?goodsId='+data.storeInfo.id)" v-if="data.replyCount > 0">
				查看更多评价
			</view>
		</view>
		<view class="cut"></view>
		<view class="detail-desc">
			<view class="d-header">
				<text class="txt">详情</text>
			</view>
			<rich-text class="rich-text" :nodes="description"></rich-text>
			<view class="d-footer">
				<text class="txt">已经到底啦</text>
			</view>
		</view>

		<!-- 底部操作菜单 -->

		<view class="page-bottom">
			<view class="left">
				<view @tap="callStore" class="p-b-btn">
					<image lazy-load src="/static/images/mall/hotline.png" mode=""></image>
					<text>客服热线</text>
				</view>
				<!-- <navigator url="/mall/index/indexPage?current=2" class="p-b-btn">
					<image lazy-load src="/static/images/mall/mall-cart.png" mode=""></image>
					<text>购物车</text>
				</navigator> -->
			</view>

			<view class="action-btn-group">
				<!-- <view class="action-btn no-border add-cart-btn" @click="toggleSpec(2)">加入购物车</view> -->
				<view class="action-btn no-border buy-now-btn" @tap="toggleSpec(1)">立即购买</view>
			</view>
		</view>

		<!-- 规格-模态层弹窗 -->
		<view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
			<!-- 遮罩层 -->
			<view class="mask"></view>
			<view class="layer attr-content" @click.stop="stopPrevent">
				<view>
					<view class="a-t">
						<image lazy-load :src="selectDisObj.image"></image>
						<view class="right">
							<text class="price">{{selectDisObj.price}}</text>
							<text class="stock">库存：{{selectDisObj.stock}}件</text>
							<view class="selected" v-if="selectDisObj.suk">
								已选：{{selectDisObj.suk}}
							</view>
						</view>
					</view>
					<view class="a-c">
						<view class="attr-list">
							<block v-for="(items, index) in specList" :key="index">
								<text class="specTitle">{{items.attr_name}}</text>
								<view class="itemBox">
									<view @tap='selectSpec(item,index,idx)' :class="subIndex[index] == idx ?'itemAct':''" class="item" v-for="(item,idx) in items.attr_value"
									 :key="idx">{{item.attr}}</view>
								</view>
							</block>
						</view>
						<!-- :max="item.productInfo.attrInfo.stock" -->
					</view>
					<view class="num">
						<text>数量</text>
						<uni-number-box class="uni-number-box" :min="1" :value="goodsNum" @eventChange="numberChange"></uni-number-box>
					</view>
					<view class="btn-box">
						<button class="btn" @click="submit">{{btnType == 1 ? '确认购买' : '确认'}}</button>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	import {
		trattDetails,
		trattAdd,
		trattConfirm
	} from '@/api/order.js'
	import {
		shareBaseUrl
	} from "@/api/api.js"


	import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue'
	import {
		systemConfig
	} from '@/api/public.js'
	import {
		rlmtDetail,
		rlmtcartAdd,
	} from '@/api/mall.js'
	import {
		formatRichText
	} from '@/utils/util.js'
	export default {
		components: {
			uniNumberBox
		},
		data() {
			return {
				id:null, //商品id
				type: '', //置换商品类型
				storeInfo: {}, //商品信息
				slider_image: [], //轮播图
				specClass: 'none', //规格弹窗开关
				specList: [], //规格列表
				selectArr: [], // 选择的规格
				selectDisObj: { //选择的规格对应产品信息
					price: 0,
				},
				goodsNum: 1, //选择的商品数量
				sku: '', //选中的规格索引
				unique: null, //选中规格标识
				btnType: 0,
				description: '', //商品详情
				reply: {}, //评价信息
				data: {
					productAttr: []
				}, //详情数据
				subIndex: [], //选中规格索引
				goodsPrice: 0, //商品价格
				scrollTop: 0,
				navColor: 'rgba(0,0,0,0)',
				navBg: "inherit",
				sideNavBg: '#BDBDBD',
				sideNavcolor: '#fff',
				backIconShow: true,
				flag: false,
				infos:{},
				shareBaseUrl:'', // 分享链接
				
			};
		},
		created() {
			this.shareBaseUrl = shareBaseUrl()
		},
		onLoad(options) {
			uni.showLoading({
				mask: true
			})
			this.id = options.id
			this.type = options.type
			// 初始数据
			trattDetails({
				id: options.id
			}).then(res => {
				uni.hideLoading()
				this.data = res.data
				this.seller_info = res.data.seller_info
				this.storeInfo = res.data.storeInfo
				this.reply = res.data.reply
				this.slider_image = res.data.storeInfo.slider_image
				if (res.data.productAttr.length !== 0) {
					this.specList = res.data.productAttr
				}
				// 默认选中的规格
				this.specList.forEach((item, index) => {
					item.attr_value.forEach((items, indexs) => {
						if (items.attr == options.sku) {
							this.selectSpec(items, index, indexs)
						}
					})

				})
				this.goodsPrice = res.data.storeInfo.price
				this.selectDisObj = res.data.storeInfo
				// 显示的已选规格
				this.selectDisObj.suk = options.sku
				this.description = formatRichText(res.data.storeInfo.description)
			})
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop
			this.navBg = "rgba(255,255,255," + e.scrollTop / 150 + ')'
			if (e.scrollTop > 10) {
				this.backIconShow = false
				this.navColor = '#333'
			} else {
				this.backIconShow = true
				this.navColor = 'rgba(0,0,0,0)'
			}
			if (e.scrollTop > 600) { //当距离大于600时显示回到顶部按钮
				this.flag = true
			} else { //当距离小于600时隐藏回到顶部按钮
				this.flag = false
			}
		},




		methods: {

			goBack() {
				uni.navigateBack()
			},
			// 分享
			share() {
				uni.share({
					provider: 'weixin',
					scene: "WXSceneSession",
					type: 0,
					imageUrl: this.storeInfo.image,
					title: this.storeInfo.store_name,
					href: this.shareBaseUrl + "/mall/product/product?id=" + this.id,
					success: ret => {
						console.log(JSON.stringify(ret));
					}
				});
			},

			navTo(url) {
				uni.navigateTo({
					url: url
				})
			},
			numberChange(e) {
				this.goodsNum = e.number;
			},
			//规格弹窗开关  3 规格  2 加入购物车  1 立即购买
			toggleSpec(type) {
				this.btnType = type
				if (this.specClass === 'show') {
					this.specClass = 'hide'
				} else if (this.specClass === 'hide' || this.specClass === 'none') {
					this.specClass = 'show'
				}
			},
			//选择规格
			selectSpec(item, index, idx) {
				if (this.selectArr[index] !== item.attr) {
					this.$set(this.selectArr, index, item.attr)
					this.$set(this.subIndex, index, idx)
					this.sku = String(this.selectArr)
					if (this.data.productValue[this.sku]) {
						this.selectDisObj = this.data.productValue[this.sku]
					}
					this.infos = this.selectDisObj
				}
			},
			submit() {
				this.selectDisObj = this.infos
				uni.showLoading({
					mask: true
				});
				if (this.btnType == 1) { //创建订单   先加购再创建
					trattAdd({
						cartNum: this.goodsNum, //购买数量
						new: 0, //1 直购买  0加入购物车
						productId: this.storeInfo.id, //商品id
						uniqueId: this.selectDisObj.unique, //商品属性唯一码
						type: 'cili_product',
					}).then(res => {
						uni.navigateTo({
							url: `/pages/center/prickly/order?cartId=${res.data.cartId}`
						})
						
					})

					
				} else if (this.btnType == 2) { //加购
					trattAdd({
						cartNum: this.goodsNum, //购买数量
						new: 0, //1 直购买  0加入购物车
						productId: this.storeInfo.id, //商品id
						uniqueId: this.selectDisObj.unique, //商品属性唯一码
						type: 'cili_product',
						// sub_type: this.type,
					}).then(res => {
						uni.hideLoading()
						uni.showToast({
							icon: "none",
							title: "成功加入购物车！"
						})
						this.specClass = 'hide'
					})
				} else if (this.btnType == 3) { //选择规格确定
					uni.hideLoading()
					this.specClass = 'hide'
				}
			},
			stopPrevent() {},
			previewPic(urls, index) {
				uni.previewImage({
					urls: urls,
					current: index
				})
			},
			callStore() {
				console.log(this.seller_info,888888)
				uni.makePhoneCall({
					phoneNumber: this.seller_info.online_phone
				})
			},

		},
		onHide() {
			this.specClass = 'none'
		},
	}
</script>

<style lang='scss' scoped>
	.container {
		overflow-x: hidden;
	}

	page {
		overflow-x: hidden;
		background: $page-color-base;
		padding-bottom: 160rpx;
	}

	.del_top {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 999;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20rpx 10rpx 20rpx 30rpx;
		box-sizing: border-box;
		background-color: red;

		.sides {
			width: 50rpx;
			height: 50rpx;
			border-radius: 50%;
			margin-right: 20rpx;
			padding: 2rpx 0 2rpx 5rpx;
		}

		.right {
			display: flex;
			justify-content: flex-end;
			align-items: center;

		}
	}

	.cut {
		width: 100%;
		height: 20rpx;
		background: #f5f5f5;
	}

	.icon-you {
		font-size: $uni-font-size-base + 1rpx;
		color: #666;
	}

	.goBack {
		position: fixed;
		z-index: 998;
		left: 30rpx;
		width: 60rpx;
		height: 60rpx;
		border-radius: 50%;
		background-color: rgba(0, 0, 0, .5);
		text-align: center;
		line-height: 60rpx;

		text {
			margin-right: -8rpx;
			color: #fff;
		}
	}

	.navigation {
		position: fixed;
		top: var(--status-bar-height);
		padding: 0 30rpx;
		height: 100rpx;
		width: 100%;
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: inherit;
		z-index: 999999;

		.back {
			width: 60rpx;
			height: 60rpx;
			border-radius: 50%;
			background-color: rgba(0, 0, 0, .5);
			display: flex;
			align-items: center;
			justify-content: center;

			.icon-zuo {
				margin-right: -10rpx;
				color: #fff;
			}
		}

		.right {
			display: flex;

			.a {
				width: 60rpx;
				height: 60rpx;
				border-radius: 50%;
				background-color: rgba(0, 0, 0, .5);
				display: flex;
				align-items: center;
				justify-content: center;
				margin-left: 30rpx;

				image {
					width: 30rpx;
				}
			}

			.b {
				image {
					width: 34rpx;
				}
			}
		}

	}

	.carousel {
		height: 722rpx;
		position: relative;

		swiper {
			height: 100%;
		}

		.image-wrapper {
			width: 100%;
			height: 100%;
		}

		.swiper-item {
			display: flex;
			justify-content: center;
			align-content: center;
			height: 750rpx;
			overflow: hidden;

			image {
				width: 100%;
				height: 100%;
			}
		}

	}

	/* 标题简介 */
	.introduce-section {
		background: #fff;

		.pd-30 {
			padding: 20rpx 30rpx;

			image {
				width: 70rpx;
				height: 28rpx;
				margin-right: 12rpx;
			}
		}

		.title {
			font-weight: bold;
			color: #333333;
			font-size: 36rpx;
			/* height: 50rpx; */
			line-height: 50rpx;
			text-align: justify;
			text-overflow: -o-ellipsis-lastline;
			overflow: hidden;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-line-clamp: 2;
			line-clamp: 2;
			-webkit-box-orient: vertical;

		}

		.black_rate {
			height: 24rpx;
			line-height: 24rpx;
			border: 1px solid rgba(255, 31, 47, 1);
			border-radius: 6rpx;
			font-size: 18rpx;
			color: rgba(255, 31, 47, 1);
			display: inline-block;
			padding: 3rpx 10rpx;
		}

		.price-box {
			display: flex;
			align-items: baseline;
			height: 64rpx;
			padding: 10rpx 0;
			font-size: 30rpx;
			color: $mall-price;

			.disc {
				color: #AAAAAA;
				font-size: 24rpx;
			}

			.shellIcon {
				width: 30rpx;
				height: 20rpx;
				margin-right: 10rpx;
			}

			.price {
				font-size: 48rpx;
				font-weight: bold;
			}
		}

		/* 标签 */

		.tags {
			color: #FA8F1C;
			font-size: 24rpx;
			margin-bottom: 15rpx;

			text {
				display: inline-block;
				padding: 0rpx 12rpx;
				text-align: center;
				height: 40rpx;
				line-height: 40rpx;
				margin: 10rpx 10rpx 0 0;
				background: #FFF2E5;
				border-radius: 10rpx;
			}

		}

		.bot-row {
			display: flex;
			align-items: center;
			height: 50rpx;
			font-size: 20rpx;
			color: #B4B4B4;
			justify-content: space-between;

			text {
				/* flex: 1;
				text-align: center; */
			}
		}
	}

	.c-list {
		font-size: $uni-font-size-sm + 2rpx;
		color: $mall-color-base;
		background: #fff;
		margin-top: 20rpx;

		.c-row {
			display: flex;
			align-items: center;
			padding: 30rpx;
			position: relative;
		}

		.b-b {
			border-top: 1px solid #E5E5E5;
		}

		.tit {
			width: 140rpx;
		}

		.con {
			flex: 1;
			color: $font-color-dark;

			.selected-text {
				margin-right: 10rpx;
			}
		}
	}

	/* 评价 */
	.eva-section {
		display: flex;
		flex-direction: column;
		padding: 30rpx;
		background: #fff;

		.e-header {
			display: flex;
			align-items: center;
			font-size: $uni-font-size-sm - 2rpx;
			color: $font-color-light;

			.tit {
				font-size: 32rpx;
				color: #333333;
				margin-right: 4rpx;
			}

			.desc {
				font-size: 22rpx;
				color: #666666;

			}

			.tip {
				flex: 1;
				text-align: right;
			}

			.icon-you {
				margin-left: 10rpx;
			}
		}

	}


	.eva-box {
		display: flex;
		padding: 20rpx 0;

		.portrait {
			flex-shrink: 0;
			width: 80rpx;
			height: 80rpx;
			border-radius: 100px;
		}

		.right {
			flex: 1;
			display: flex;
			flex-direction: column;
			font-size: $uni-font-size-base;
			color: $mall-color-base;
			padding-left: 26rpx;

			.con {
				font-size: $uni-font-size-base;
				color: $font-color-dark;
				padding: 20rpx 0;
			}

			.bot {
				display: flex;
				justify-content: space-between;
				font-size: $uni-font-size-sm;
				color: $font-color-light;
			}
		}

		.comment-pics {
			width: 100%;
			display: flex;
			justify-content: space-between;
			padding: 30rpx 0;

			image {
				width: 33%;
				height: 200rpx;
				border-radius: 10rpx;

			}
		}
	}

	.more-comm {
		width: 180rpx;
		margin: 20rpx auto;
		line-height: 60rpx;
		height: 60rpx;
		border: 1px solid rgba(153, 153, 153, 1);
		border-radius: 30rpx;
		font-size: 20rpx;
		color: rgba(51, 51, 51, 1);
		text-align: center;

	}

	.shop {
		margin: 40rpx 32rpx;
		display: flex;
		position: relative;

		image {
			width: 120rpx;
			height: 120rpx;
			border-radius: 8rpx;
		}

		.infoBox {
			display: flex;
			flex-direction: column;
			justify-content: center;
			margin-left: 25rpx;

			.title {
				font-size: 28rpx;
				font-weight: bold;
				color: rgba(51, 51, 51, 1);
				margin-bottom: 28rpx;
			}

			.info__rate {
				font-size: 24rpx;
				color: rgba(51, 51, 51, 1);
			}

			.rate {
				margin-left: 12rpx;
			}
		}

		.goto {
			position: absolute;
			top: 30%;
			right: 12rpx;
			font-size: 24rpx;
			color: #333333;

			.name {
				padding-right: 10rpx;
			}
		}
	}

	/*  详情 */
	.detail-desc {
		background: #fff;
		margin-top: 16rpx;
		padding-bottom: 250rpx;

		.d-header {
			display: flex;
			justify-content: center;
			align-items: center;
			height: 80rpx;
			font-size: 32rpx;
			font-weight: bold;
			color: #333333;
			position: relative;
			font-weight: Medium;

			.bar {
				font-weight: bold;
			}

			.txt {
				padding: 0 40rpx;
				background: #fff;
				position: relative;
				z-index: 1;
			}

			&:after {
				position: absolute;
				left: 50%;
				top: 50%;
				transform: translateX(-50%);
				width: 200rpx;
				height: 0;
				content: '';
				border-bottom: 2px solid #333;
			}
		}

		.d-footer {
			display: flex;
			justify-content: center;
			align-items: center;
			height: 80rpx;
			font-size: 24rpx;
			color: #999;
			position: relative;
			font-weight: Medium;

			.bar {
				font-weight: bold;
			}

			.txt {
				padding: 0 40rpx;
				background: #fff;
				position: relative;
				z-index: 1;
			}

			&:after {
				position: absolute;
				left: 50%;
				top: 50%;
				transform: translateX(-50%);
				width: 250rpx;
				height: 0;
				content: '';
				border-bottom: 1px solid #999;
			}
		}

		.rich-text {
			width: 100%;
			overflow-x: hidden;

			.img {
				width: 100%;
			}

			image {
				width: 100%;
			}
		}
	}

	/* 规格选择弹窗 */
	.attr-content {
		padding: 30rpx;
		box-sizing: border-box;

		.a-c {
			position: absolute;
			top: 150rpx;
			bottom: 210rpx;
			overflow-y: scroll;
		}

		.a-t {
			display: flex;

			image {
				width: 170rpx;
				height: 170rpx;
				flex-shrink: 0;
				margin-top: -70rpx;
				border-radius: 8rpx;
			}

			.right {
				display: flex;
				flex-direction: column;
				padding-left: 24rpx;
				font-size: 20rpx;
				color: #999;
				line-height: 30rpx;

				.price {
					line-height: 40rpx;
					font-weight: bold;
					font-size: $uni-font-size-lg;
					color: $mall-price;

					&:before {
						content: '￥';
						font-size: 20rpx;
					}
				}
			}
		}

		.num {
			position: absolute;
			left: 0;
			bottom: 120rpx;
			height: 100rpx;
			width: 100%;
			padding: 0 30rpx;
			box-sizing: border-box;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.uni-number-box {
				width: 200rpx;
				height: 50rpx;
				position: relative;
			}
		}

		.btn-box {
			position: absolute;
			left: 0;
			bottom: 0;
			width: 100%;
			border-top: 1px solid #eee;
			z-index: 99;
			height: 119rpx;
			display: flex;
			align-items: center;

			.btn {
				height: 76rpx;
				line-height: 76rpx;
				border-radius: 38rpx;
				background: $mall-price;
				font-size: 28rpx;
				color: #fff;
				width: 690rpx;
			}
		}

		.attr-list {
			padding-top: 30rpx;

			.specTitle {
				font-size: 28rpx;
				color: #999;
			}

			.itemBox {
				margin-top: 30rpx;
				display: flex;
				flex-wrap: wrap;

				.item {
					font-size: 24rpx;
					height: 50rpx;
					line-height: 50rpx;
					text-align: center;
					color: #999;
					border: 1rpx solid #999;
					margin-right: 30rpx;
					padding: 0 30rpx;
					border-radius: 25rpx;
					margin-bottom: 30rpx;
				}

				.itemAct {
					background-color: $mall-price;
					border: 1rpx solid $mall-price;
					color: #fff;
				}
			}
		}

	}

	/*  弹出层 */
	.popup {
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 99;

		&.show {
			display: block;

			.mask {
				animation: showPopup 0.2s linear both;
			}

			.layer {
				animation: showLayer 0.2s linear both;
			}
		}

		&.hide {
			animation: hideLayer 0.2s linear both;

			.mask {
				animation: hideLayer 0.2s linear both;
			}

			.layer {
				animation: hideLayer 0.2s linear both;
			}
		}

		&.none {
			display: none;
		}

		.mask {
			position: fixed;
			top: 0;
			width: 100%;
			height: 100%;
			z-index: 1;
			background-color: rgba(0, 0, 0, 0.4);
		}

		.layer {
			position: fixed;
			z-index: 99;
			bottom: 0;
			padding-bottom: env(safe-area-inset-bottom);
			width: 100%;
			height: 70vh;
			border-radius: 10rpx 10rpx 0 0;
			background-color: #fff;
		}

		@keyframes showPopup {
			0% {
				opacity: 0;
			}

			100% {
				opacity: 1;
			}
		}

		@keyframes hidePopup {
			0% {
				opacity: 1;
			}

			100% {
				opacity: 0;
			}
		}

		@keyframes showLayer {
			0% {
				transform: translateY(120%);
			}

			100% {
				transform: translateY(0%);
			}
		}

		@keyframes hideLayer {
			0% {
				transform: translateY(0);
			}

			100% {
				transform: translateY(120%);
			}
		}
	}

	/* 底部操作菜单 */
	.page-bottom {
		position: fixed;
		bottom: 0;
		left: 0;
		padding-bottom: env(safe-area-inset-bottom);
		z-index: 95;
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		height: 110rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
		background: #fff;
		box-shadow: 0 0 20rpx 0 rgba(0, 0, 0, .1);

		.left {
			display: flex;
			align-items: center;

			.p-b-btn {
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				font-size: 18rpx;
				color: rgba(51, 51, 51, 1);
				width: 110rpx;
				height: 80rpx;
				margin-right: 10rpxs;

				image {
					width: 40rpx;
					height: 40rpx;
					margin-bottom: 5rpx;
				}

				.active {
					color: $mall-price;
				}
			}
		}


		.action-btn-group {
			display: flex;
			justify-content: flex-end;
			line-height: 70rpx;
			text-align: center;
			color: #fff;
			font-size: 26rpx;
			width: 400rpx;

			.add-cart-btn {
				width: 200rpx;
				height: 70rpx;
				background: linear-gradient(90deg, #FB3737 0%, #FD5252 100%);
				border-radius: 35px 0px 0px 35px;
			}

			.buy-now-btn {
				width: 200rpx;
				height: 70rpx;
				background: #FB3737;
				border-radius: 35px;
			}
		}
	}
</style>
